﻿<UserControl
    x:Class="WinRTXamlToolkit.Sample.Views.AlternativeFrameTestView"
    IsTabStop="false"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:WinRTXamlToolkit.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Extensions="using:WinRTXamlToolkit.Controls.Extensions"
    mc:Ignorable="d">

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition
                Width="2*" />
            <ColumnDefinition
                Width="Auto" />
            <ColumnDefinition
                Width="*" />
        </Grid.ColumnDefinitions>
        <controls:AlternativeFrame
            x:Name="subFrame"
            Extensions:FrameworkElementExtensions.ClipToBounds="True"
            Visibility="Collapsed">
            <controls:AlternativeFrame.PageTransition>
                <controls:PushTransition
                    ForwardDirection="Random"
                    BackwardDirection="Random" />
                <!--<controls:WipeTransition />-->
                <!--<controls:DissolveTransition />-->

                <!-- FlipTransitions look cool, but unfortunately the XAML framework is not stable when working with Projections -->
                <!--<controls:FlipTransition
                        AxisOfFlip="Center"
                        Duration="0:0:1.5"/>-->
                <!--<controls:FlipTransition
                        AxisOfFlip="Center" />-->
                <!--<controls:FlipTransition
                        AxisOfFlip="Random"
                        ForwardDirection="Random"
                        BackwardDirection="Random" />-->
                <!-- Looks like a fluorescent lamp with a slow start :) -->
                <!--<controls:DissolveTransition
                        Duration="0:0:1.5">
                        <controls:DissolveTransition.EasingFunction>
                            <BounceEase
                                EasingMode="EaseInOut" />
                        </controls:DissolveTransition.EasingFunction>
                    </controls:DissolveTransition>-->

                <!-- Looks weird -->
                <!--<controls:WipeTransition
                        Duration="0:0:1.5">
                        <controls:WipeTransition.EasingFunction>
                            <BounceEase
                                EasingMode="EaseInOut" />
                        </controls:WipeTransition.EasingFunction>
                    </controls:WipeTransition>-->
            </controls:AlternativeFrame.PageTransition>
        </controls:AlternativeFrame>
        <controls:CustomGridSplitter
            Grid.Column="1"
            Width="12" />
        <Grid
            x:Name="FrameTestControlsPanel"
            Grid.Column="2"
            Margin="5,0,0,0">
            <Grid.Resources>
                <DataTemplate
                    x:Key="JournalEntryDataTemplate">
                    <StackPanel
                        Margin="0,0,0,5">
                        <StackPanel
                            Orientation="Horizontal">
                            <TextBlock
                                Text="SourcePageType: " />
                            <TextBlock
                                Text="{Binding SourcePageType}" />
                        </StackPanel>
                        <StackPanel
                            Orientation="Horizontal">
                            <TextBlock
                                Text="Parameter: " />
                            <TextBlock
                                Text="{Binding Parameter}" />
                        </StackPanel>
                    </StackPanel>
                </DataTemplate>
            </Grid.Resources>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition
                    Height="Auto" />
                <RowDefinition
                    Height="Auto" />
                <RowDefinition
                    Height="Auto" />
                <RowDefinition
                    Height="Auto" />
                <RowDefinition
                    Height="*" />
            </Grid.RowDefinitions>
            <Button
                x:Name="GetNavigationStateButton"
                Content="GetNavigationState()"
                HorizontalAlignment="Center"
                Click="GetNavigationStateButton_OnClick" />
            <Button
                x:Name="SetNavigationStateButton"
                Grid.Column="1"
                Content="SetNavigationState()"
                HorizontalAlignment="Center"
                Click="SetNavigationStateButton_OnClick" />
            <TextBlock
                Grid.Row="1"
                Grid.ColumnSpan="2"
                Text="Navigation State"
                Margin="0,0,0,10"
                Style="{StaticResource SubheaderTextStyle}" />
            <TextBox
                x:Name="NavigationStateTextBox"
                Grid.Row="2"
                Grid.ColumnSpan="2"
                TextWrapping="Wrap"
                ScrollViewer.VerticalScrollBarVisibility="Auto" />
            <controls:CustomGridSplitter
                Grid.Row="3"
                Grid.ColumnSpan="2"
                Height="12" />
            <ScrollViewer
                Grid.Row="4"
                Grid.ColumnSpan="2">
                <StackPanel>
                    <TextBlock
                        Text="BackStack"
                        Style="{StaticResource SubheaderTextStyle}" />
                    <ItemsControl
                        x:Name="BackStackItemsControl"
                        ItemsSource="{Binding BackStack, ElementName=subFrame}"
                        ItemTemplate="{StaticResource JournalEntryDataTemplate}" />
                    <TextBlock
                        Text="CurrentJournalEntry"
                        Style="{StaticResource SubheaderTextStyle}" />
                    <ContentControl
                        x:Name="CurrentJournalEntryContentControl"
                        ContentTemplate="{StaticResource JournalEntryDataTemplate}" />
                    <TextBlock
                        Text="ForwardStack"
                        Style="{StaticResource SubheaderTextStyle}" />
                    <ItemsControl
                        x:Name="ForwardStackItemsControl"
                        ItemsSource="{Binding ForwardStack, ElementName=subFrame}"
                        ItemTemplate="{StaticResource JournalEntryDataTemplate}" />
                </StackPanel>
            </ScrollViewer>
        </Grid>
    </Grid>
</UserControl>